using System;
using System.Collections.Generic;

namespace Pharmacy.Ultilities
{
    /// <summary>
    /// Provides global access for most used variables.
    /// </summary>
    /// <author></author>
    /// <history>
    /// 2011.01.27 - ThangTran: added Xml-doc, added UserID property.
    /// 2011.01.29 - ThangTran: added IsAdmin.
    /// </history>
    public static class Global
    {
        /// <summary>
        /// Gets or sets logging user.
        /// </summary>
        private static string _userName = string.Empty;

        /// <summary>
        /// Gets or sets logging user.
        /// </summary>
        public static string UserName
        {
            get { return _userName; }
            set { _userName = value; }
        }

        /// <summary>
        /// Gets or sets logging user ID.
        /// </summary>
        public static int UserID { get; set; }

        /// <summary>
        /// Gets or sets value that indicates whether the application behavior looks like debug or release mode.
        /// If IsDebug is TRUE, addition technical information and message/error box should be shown.
        /// </summary>
// ReSharper disable InconsistentNaming
        private const bool _isDebug = false;
// ReSharper restore InconsistentNaming

        /// <summary>
        /// Gets or sets value that indicates whether the application behavior looks like debug or release mode.
        /// If IsDebug is TRUE, addition technical information and message/error box should be shown.
        /// </summary>
        public static bool IsDebug
        {
            get
            {
#if DEBUG
                return _isDebug;
#else
                return false;
#endif
            }
        }

        /// <summary>
        /// Gets a value that indicates ID of current application.
        /// </summary>
        public static int CurrentAppID
        {
            get { return 1; }
        }

        /// <summary>
        /// Gets a value that indicates whether current logging user is in admin group.
        /// </summary>
        public static bool CurrentUserIsAdmin { get; set; }

        public static string CurrentConnectionString { get; set; }
    }
}
